A novel coupled rainfall prediction model based on stepwise decomposition technique

The traditional decomposed ensemble prediction model decomposes the entire rainfall sequence into several sub-sequences, dividing them into training and testing periods for modeling. During sample construction, future information is erroneously mixed into the training data, making it challenging to apply in practical rainfall forecasting. This paper proposes a novel stepwise decomposed ensemble coupling model, realized through variational mode decomposition (VMD) and bidirectional long short-term memory neural network (BiLSTM) models. Model parameters are optimized using an improved particle swarm optimization (IPSO). The performance of the model was evaluated using rainfall data from the Southern Four Lakes basin. The results indicate that: (1) Compared to the PSO algorithm, the IPSO algorithm-coupled model shows a minimum decrease of 2.70% in MAE and at least 2.62% in RMSE across the four cities in the Southern Four Lakes basin; the IPSO algorithm results in a minimum decrease of 25.58% in MAE and at least 28.19% in RMSE for the VMD-BiLSTM model. (2) When compared to IPSO-BiLSTM, the VMD-IPSO-BiLSTM based on the stepwise decomposition technique exhibits a minimum decrease of 26.54% in MAE and at least 34.16% in RMSE. (3) The NSE for the testing period of the VMD-IPSO-BiLSTM model in each city surpasses 0.88, indicating higher prediction accuracy and providing new insights for optimizing rainfall forecasting.

known information for constructing ensemble decomposition models results in "false" high-precision prediction outcomes.Some scholars have proposed stepwise decomposition techniques, wherein the observed sequence is initially divided into training and testing periods, followed by decomposition modeling of the training period, thus preventing the incorporation of future information into the training samples.Models developed based on stepwise decomposition techniques demonstrate reliable performance 21,22 .Wei et al. introduced a stepwise decomposition sampling technique to construct accurate decomposition ensemble models, aiming to enhance the prediction accuracy of correctly decomposed ensemble models 20 .
This study utilizes weekly rainfall data from the Nansi Lake Basin and employs a stepwise decomposition technique combined with variational mode decomposition (VMD) to construct training and testing sets for rainfall prediction models.A VMD-BiLSTM coupled model is developed to forecast the weekly rainfall sequence in the Nansi Lake Basin, with model parameters optimized using an improved particle swarm optimization (IPSO) algorithm.This model effectively addresses the issue of traditional ensemble decomposition models incorporating future information, thereby enhancing the prediction accuracy of decomposition ensemble models.

Variational mode decomposition
The variational mode decomposition (VMD) 23 method is an innovative, fully non-recursive data decomposition approach that is adaptive in nature.This method achieves the decomposition of the original signal x into a series of Intrinsic Mode Functions (IMFs) by seeking the optimal solution to a constrained variational problem.
where k represents the number of to the central frequency of the kth modal component; t stands for time; ∂ t is the first-order derivative of the function with respect to time t ; δ(t) is the unit impulse function; j represents the imaginary unit; ⊗ signifies the convolution operation.
where α represents the quadratic penalty factor; denotes the Lagrange multiplier.(t) is the value of at time t , and x(t) is the value of x at time t .The alternating direction multiplier iteration algorithm is employed to solve the saddle point of Eq. (2).

Improved particle swarm optimization
Due to the fact that in the basic particle swarm optimization algorithm, parameters ω、c 1 、c 2 are constants, the optimization process is highly susceptible to getting trapped in local optima, and its optimization capability is relatively poor when dealing with multiple objective functions and constraints.Therefore, an optimized improvement is proposed for the basic particle swarm optimization algorithm, aiming to make it more suitable for multi-objective problem solving.
where ω ′ is the improved inertia weight factor, with ω max set to 0.9 and ω min to 0.2; c ′ 1 and c ′ 2 are the refined learning factors; t cur represents the current generation count; t max is the maximum number of iterations; c 1f and c 2f are the termination values for c 1 and c 2 , set to 0.5 and 2, respectively; c 1i and c 2i are the initial values, taken as 2 and 0.5, respectively.
where P is the average of the optimal values of all individual particles; N is the number of particles; P t ij is the location of the optimal values of individual particles.The improved expression of the algorithm is: (1) where υ t+1 ij is the velocity of the particle; t is the number of selected generations; r 1 , r 2 are random numbers in the interval [0-1], x t ij is the position of the particle for t iterations; P t gj is the current optimal value position of all particles of the population.

Bidirectional long short-term memory neural network
LSTM 24 is a deep neural network that can accurately and efficiently learn long-term dependent information by introducing a gating mechanism that allows the model to selectively retain the function of transmitting long-term timing data information 25 .As shown in Fig. 1, it consists of three gates, input gate, output gate and forgetting gate and one core computing node.The forgetting gate, the input gate, and the output gate jointly realise the control to the unit state, selectively adding or removing information to the unit state.
BiLSTM 26 network is composed of forward and reverse LSTM neural networks, which can realise forward and reverse two LSTM training for time series, and effectively improve the comprehensiveness and completeness of feature selection.The structure of BiLSTM 27 is shown in Fig. 2.
The output h t of the forward LSTM layer in Fig. 2 is connected to the output ← h t of the backward LSTM layer, which is weighted and fused to obtain the final power output value O t .The BiLSTM equation is: where i t is the input eigenvector; h t , ← h t forward and backward power predictions; is the bidirectional output connection weight matrix, b t is the output layer bias, and O t the final output power prediction of the network.

Model construction
Stepwise decomposition for sample construction (1) The rainfall sequences As shown in Fig. 3, the training set and test set ratios of 9:1,8:2,7:3 are considered.
The violin plots illustrate the distribution of the rainfall sequences for the three allocation ratios.
According to Fig. 3, it is evident that the rainfall data for Heze, Jining, Xuzhou, and Zaozhuang exhibit relatively uniform overall distributions.The kernel density distributions of training and testing datasets are closer under both 8:2 and 7:3 allocations.By considering the closest match in terms of mean and standard deviation as indicated in Table 1, the final decision is made to set the training and testing set ratios for Heze and Zaozhuang at 7:3, while for Jining and Xuzhou, the ratios are set at 8:2.
) , which is then decomposed into K sub- sequences.New data is sequentially added to (S 1 , S 2 , • • • , S m ) for decomposition.(3) Each sequence can be decomposed into K sub-sequences, from which the last m elements of each sub- sequence are extracted as explanatory variables.These explanatory variables serve as initial input data for the coupled model, which is then fine-tuned to predict the values of the response variable.(4) The response variables of the sub-sequences obtained through decomposing sequence ) are illustrated in Fig. 4, depicting the stepwise decomposition sampling technique 12 .

Statistical evaluation indicators
To validate the predictive superiority of the stepwise decomposition-based VMD-IPSO-BiLSTM model, it is compared with the IPSO-BiLSTM model.Additionally, to assess the advantages of the IPSO optimization algorithm, a comparison is made between the IPSO algorithm and the conventional PSO algorithm.The predictive performance of the models is evaluated using three error metrics: mean absolute error (MAE), root mean square error (RMSE), and Nash-Sutcliffe efficiency (NSE where P is the observed value, P * is the predicted value, P is the mean of observed values. (

Data sources
Nansi Lake, located in Shandong Province, China, is the largest lake in the province and one of the largest freshwater lakes in China.With a basin area of 31,700 km 2 , it serves multiple ecological functions and serves as a crucial reservoir for the South-to-North Water Diversion Project, playing a significant role in water diversion and storage.The average annual precipitation in the South Four Lakes basin is 731 mm, with a total storage capacity of 4.731 billion m3 and an average annual available water volume of 1.273 billion m3.An overview of the study area is presented in Fig. 5.The map in Fig. 5 was created using the ArcGIS software version10.8,available at http:// www.esri.com/ softw are/ arcgis.The Nansi Lake Basin encompasses the cities of Heze, Jining, Xuzhou, and Zaozhuang.Daily data for these four cities were obtained from the National Meteorological Science Data Center (https:// data.cma.cn/).The 7671 daily rainfall data points spanning from January 1, 2000, to December 31, 2020, were organized into 1096 sets of weekly rainfall data.The data was split according to the allocation ratios for the training and testing periods.For Heze and Zaozhuang, the training period spans from January 1, 2000, to September 26, 2014, and the testing period from September 27, 2014, to December 31, 2020.For Jining and Xuzhou, the training period extends from January 1, 2000, to October 28, 2016, and the testing period from October 29, 2016, to December 31, 2020.Please refer to Fig. 6 for details.

Model training
The BiLSTM model features a bidirectional recurrent neural network with input and output layers, as well as hidden layers.The Adam optimizer is selected to update the model parameters.The IPSO optimization model is configured with a population size of 50, an inertia weight of 0.7, and individual learning factors C 1 and social learning factors C 2 as shown in Table 2.
Addressing issues such as manual parameter tuning and slow convergence speed in the BiLSTM neural network predictive model, the particle swarm optimization (PSO) algorithm is employed to optimize the iteration count (N), learning rate (L), the number of nodes in the first hidden layer ( H 1 ), and the number of nodes in the second hidden layer ( H 2 ).The optimal parameter combination is ultimately obtained, as presented in Table 2.

Model prediction results
To better analyze the predictive performance of each model during the testing period, Fig. 7  distribution of IPSO-BiLSTM is more compact, and the slope of the linear fitting line is closer to 1 during the testing period for each city.Additionally, comparing the predictive results of VMD-PSO-BiLSTM and VMD-IPSO-BiLSTM shows that the slopes of VMD-IPSO-BiLSTM are all greater than 0.78, indicating a more compact scatter distribution.This suggests that the IPSO-optimized VMD-BiLSTM model outperforms the VMD-BiLSTM model optimized with conventional PSO.The IPSO algorithm demonstrates its ability to enhance the predictive

Multi-model comparison
Table 3 presents the model accuracy evaluation results during the training and testing periods for the IPSOoptimized models.During the training period, PSO-BiLSTM, IPSO-BiLSTM, and VMD-PSO-BiLSTM demonstrated optimal simulation results in Heze, while VMD-IPSO-BiLSTM exhibited superior performance in simulating Zaozhuang.In the testing period, VMD-IPSO-BiLSTM outperformed other models in terms of performance across all cities.As shown in Table 3. Comparing the prediction results of PSO-BiLSTM and IPSO-BiLSTM for each city in the test period, it can be seen that the MAE and RMSE values of the IPSO-BiLSTM model are smaller, and the NSE value is closer to 1.The MAE value decreases from 6.30 to 7.65 to 6.13 to 6.97, and the RMSE decreases from 10.94 to 12.99 to 9.66 to 11.91.NSE values improved from 0.43 ~ 0.50 to 0.309 ~ 0.630, indicating that the performance of the IPSO-optimised BiLSTM model is better than that of the ordinary PSO-optimised BiLSTM model.The IPSO algorithm can improve the model overfitting problem, and thus improve the predictive performance of the model.
Comparing the predictions of IPSO-BiLSTM and VMD-IPSO-BiLSTM, the VMD-IPSO-BiLSTM model demonstrates the most significant reduction in MAE in Jinan, reaching 45.73%.The RMSE value sees the most noticeable decrease in Zaozhuang, reaching 48.78%.This implies that the stepwise decomposition technique based on VMD significantly improves the performance of the coupled prediction model, leading to a minimum 45% increase in NSE values for rainfall testing across all cities.
To assess model accuracy, Taylor diagrams were employed, as depicted in Fig. 8.The correlation coefficients and standard deviations of different models for the four cities were compared.Concerning the correlation coefficients, the simulation results for Heze, Jinan, and Xuzhou fall within the range of 0.9 to 0.99, while Zaozhuang's simulation results range from 0.8 to 0.99.Regarding standard deviations, VMD-IPSO-BiLSTM closely approximates observed values in terms of standard deviations across all four cities.

Discussion
The traditional decomposition-prediction coupling model technique, when applied to decompose time series data, may inadvertently introduce some testing period data into the training period.Constructing a decomposition ensemble model can result in "false" high-accuracy prediction outcomes, making it challenging for the model to meet the demands of practical forecasting work 19,20 .The VMD-IPSO-BiLSTM model, based on the stepwise decomposition technique, sequentially appends new data S m+1 to the existing sequence segment (S 1 , S 2 , • • • , S m ) for decomposition, gradually extends the sequence segment, and extracts corresponding explanatory samples.Compared to previous VMD-BiLSTM approaches 28,29 , the model performance is significantly enhanced by optimizing model parameters through the IPSO optimization algorithm.Notably, the VMD-IPSO-BiLSTM model does not utilize testing period data during model training.However, in contrast to optimized prediction models based on traditional decomposition methods 30 , the predictive accuracy of the stepwise decomposition model is relatively lower.Therefore, further considerations are needed to improve model accuracy in the future.

Conclusion
To enhance the accuracy of rainfall prediction models, this paper introduces a novel VMD-IPSO-BiLSTM stepwise decomposition ensemble model.Comparative analysis of the prediction results with the PSO-BiLSTM, IPSO-BiLSTM, and VMD-PSO-BiLSTM models reveals the following research findings: (1) Compared with PSO-BiLSTM, the MAE value of IPSO-BiLSTM model decreases from 6.30 to 7.65 to 6.13 to 6.97, the RMSE decreases from 10.94 to 12.99 to 9.66 to 11.91, and the NSE value improves from 0.43 to 0.50 to 0.309 to 0.630, which indicates that the IPSO-optimised BiLSTM model parameters with better performance.(2) Contrast between IPSO-BiLSTM and VMD-IPSO-BiLSTM predictions reveals that the VMD-IPSO-BiLSTM model achieves the most substantial reduction in MAE in Jinan, reaching 45.73%.RMSE values experience the most notable decrease in Zaozhuang at 48.78%.This highlights the significant improvement in the performance of the coupled prediction model based on VMD's stepwise decomposition technique, leading to a minimum 45% increase in NSE values during the rainfall testing period across various cities.(3) VMD-IPSO-BiLSTM effectively addresses the issue of erroneously using validation period forecast factor numbers in traditional decomposition ensemble prediction models.NSE values during the testing period exceed 0.88 in all cities, indicating higher predictive accuracy.This model provides valuable reference for the correct establishment of decomposition ensemble rainfall prediction models and serves as a basis for practical forecasting of non-stationary and non-linear rainfall sequences.

Figure 3 .
Figure 3. Scale violin diagram for the division of training and testing periods.

Figure 6 .
Figure 6.Weekly rainfall series of four cities in the South Four Lakes basin.

2 C
1 C 1 accuracy of both individual models and decomposition ensemble models.In comparison to the two individual models (PSO-BiLSTM and IPSO-BiLSTM), the hybrid models (VMD-PSO-BiLSTM and VMD-IPSO-BiLSTM) exhibit superior performance in rainfall prediction across the four cities.

Figure 7 .
Figure 7. Scatterplot of rainfall series prediction results for each city.

Table 1 .
Precipitation characteristic indexes in training set and testing set.

Mean Standard deviation Mean Standard deviation Mean Standard deviation
Vol.:(0123456789) Scientific Reports | (2024) 14:10853 | https://doi.org/10.1038/s41598-024-61855-0www.nature.com/scientificreports/(2) Sequence (S 1 , S 2 ).Smaller MAE and RMSE values and an NSE closer to 1 indicate better point prediction performance of the model.Due to the stochastic nature of the coupled model, the weekly rainfall time series data for the four cities are run 20 times, recording the results for evaluation based on error and model performance metrics.The Nash-Sutcliffe efficiency (NSE), root mean square error (RMSE), and mean absolute error (MAE) are employed as model error evaluation metrics, with the following formulas:

Table 2 .
Table of optimal parameter combinations for each model.

Table 3 .
Evaluation results of each model in the training and testing periods.